﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style x:Key="SkinButton" TargetType="Button">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        
        <Setter Property="Canvas.Top">
            <Setter.Value>
                <Binding Path="MouseOff.Top" />
            </Setter.Value>
        </Setter>
        <Setter Property="Canvas.Left">
            <Setter.Value>
                <Binding Path="MouseOff.Left" />
            </Setter.Value>
        </Setter>
        <Setter Property="Height">
            <Setter.Value>
                <Binding Path="MouseOff.Height" />
            </Setter.Value>
        </Setter>
        <Setter Property="Width">
            <Setter.Value>
                <Binding Path="MouseOff.Width" />
            </Setter.Value>
        </Setter>
        <Setter Property="Cursor">
            <Setter.Value>
                <Binding Path="MouseOff.Cursor" />
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate 
                        TargetType="{x:Type Button}">
                    <Image Name="image" Source="{Binding Path=MouseOff.Source}"/>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="image" Property="Source">
                                <Setter.Value>
                                    <Binding Path="MouseOver.Source" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Canvas.Top">
                                <Setter.Value>
                                    <Binding Path="MouseOver.Top" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Canvas.Left">
                                <Setter.Value>
                                    <Binding Path="MouseOver.Left" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Height">
                                <Setter.Value>
                                    <Binding Path="MouseOver.Height" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Width">
                                <Setter.Value>
                                    <Binding Path="MouseOver.Width" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Cursor">
                                <Setter.Value>
                                    <Binding Path="MouseOver.Cursor" />
                                </Setter.Value>
                            </Setter>
                        </MultiTrigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="image" Property="Source">
                                <Setter.Value>
                                    <Binding Path="MouseDown.Source" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Canvas.Top">
                                <Setter.Value>
                                    <Binding Path="MouseDown.Top" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Canvas.Left">
                                <Setter.Value>
                                    <Binding Path="MouseDown.Left" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Height">
                                <Setter.Value>
                                    <Binding Path="MouseDown.Height" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Width">
                                <Setter.Value>
                                    <Binding Path="MouseDown.Width" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Cursor">
                                <Setter.Value>
                                    <Binding Path="MouseDown.Cursor" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>